<template>
  <div>
      <TopBar>提现管理</TopBar>
        <section class="cashSection"  style="margin-top:1.5rem">
          <CashItem :bank="bank" :name="name" :idcard="idcard">绑定银行卡</CashItem>
          <CashAlipay :alipay="alipay" :name="name" :idcard="idcard">绑定支付宝</CashAlipay>
        </section>
  </div>
</template>
<script>
import TopBar from '../../component/common/TopBar'
import CashItem from '../cashManager/children/CashItem'
import CashAlipay from '../cashManager/children/CashAlipay'
import {getBindInfo} from '../../../service/getData'
import {getStore} from '../../../config/mUtils'
import {getSDK} from '../../../service/wxShare.js'

export default {
  components:{
    TopBar,
    CashItem,
    CashAlipay
  },
  beforeCreate(){
    getSDK()
  },
  mounted(){
    getBindInfo(getStore('loginkey'))
      .then(res=>{
        console.log(res);
        if(res.status == 1){
          this.name = res.name||''
          this.idcard = res.idcard||''
          if(res.bank){
            this.bank = res.bank
          }
          if(res.alipay){
            this.alipay = res.alipay
          }
        }
      })
  },
  data(){
    return {
      bank:null,
      alipay:null,
      name:'',
      idcard:''
    }
  }
}
</script>
<style lang="less">
  @import '../../../style/mixin.less';

  .cashSection{
    .wh(90%,100%);
    margin: 0 auto;
  }
</style>
